import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Dragdemo from '../pages/dragDemo/dragDemo'
import Lunb from '../pages/lunb'
import markdown from '../pages/markdown'

import newViews from '../router/modules/newViews'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: '/',
    component: Home,
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
  },
  {
    path: '/map',
    name: 'mapdemo',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ '../pages/mapdemo/map.vue'),
  },
  {
    path: '/mapJ',
    component: () =>
      import(/* webpackChunkName: "about" */ '../pages/Juejinmap/map-demo.vue'),
  },
  {
    path: '/mapOrign',
    component: () =>
      import(/* webpackChunkName: "about" */ '../pages/mapdemoOrigin/map.vue'),
  },
  {
    path: '/dragdemo',
    name: 'dragdemo',
    component: Dragdemo,
  },
  {
    path: '/lunb',
    name: 'lunb',
    component: Lunb,
  },
  {
    path: '/markdown',
    name: 'markdown',
    component: markdown,
  },
  // 富文本
  {
    path: '/quilleditor',
    component: () =>
      import(/* webpackChunkName: "about" */ '../pages/quill-editor/index.vue'),
  },
  // 为了模拟跨域问题
  {
    path: '/crossdomain',
    component: () =>
      import(/* webpackChunkName: "about" */ '../pages/crossDomain/index.vue'),
  },
  {
    path: '/zqzb',
    component: () =>
      import(/* webpackChunkName: "about" */ '../pages/zqzb/zqzb.vue'),
  },
  // 培训演示tabledemo
  {
    path: '/free/tabledemo',
    component: () =>
      import(/* webpackChunkName: "about" */ '../pages/tableDemo/index.vue'),
  },
  {
    path: '/notes',
    component: () =>
      import(/* webpackChunkName: "about" */ '../pages/notes/axios-note'),
  },
  // 游离页面
  {
    path: '/free/vuextest',
    component: () =>
      import(
        /* webpackChunkName: "about" */ '../pages/vuex-test/vuex-test01.vue'
      ),
  },
  {
    path: '/free/daping',
    component: () =>
      import(
        /* webpackChunkName: "about" */ '../pages/daping/index.vue'
      ),
  },
  {
    path: '/free/daping1',
    component: () =>
      import(
        /* webpackChunkName: "about" */ '../pages/daping/daping1/index.vue'
      ),
  },
]

export const baseRoute =Object.assign(routes,newViews)

const router = new VueRouter({
  mode: 'history',
  // mode: "hash",
  base: process.env.BASE_URL,
  routes:baseRoute,
})

export default router
